public class Test01 {
    //删除有序数组中的重复项
    public int removeDuplicates(int[] nums) {
        int length = nums.length;
        int index = 0;
        for(int i =0;i<length;){
            nums[index] = nums[i];
            while(i < length && nums[i] == nums[index]){
                i++;
            }
            index++;
        }
        return index;
    }
}
